package org.example.demo.test.search.strategy.reveal.defau;

import com.example.demo.test.AbstractStrategyRouter;
import com.example.demo.test.StrategyHandler;
import com.example.demo.test.parm.InClass;
import com.example.demo.test.parm.OutClass;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Data
@Component
@Slf4j
public class ExpandTime  extends AbstractStrategyRouter<InClass, OutClass> implements StrategyHandler<InClass,OutClass>{
    @Autowired
    private ExpandTime expandTime;
    private Integer type;
    @Override
    public OutClass apply(InClass param) {
        //type=1
        if(param.getNumFound()<=20) {
            return applyStrategy(param);
        }else if(param.getNumFound()<=5){
            return applyStrategy(param);
        }else{
            return applyStrategy(param);
        }
    }


    @Override
    protected StrategyMapper<InClass, OutClass> registerStrategyMapper() {
        return new StrategyMapper<InClass, OutClass>() {
            @Override
            public StrategyHandler<InClass, OutClass> get(InClass param) {
                return expandTime;
            }
        };
    }
}
